<?php include 'CheckSession.php'; ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>管理员管理</title>
    <link href="css/style.css" rel="stylesheet" type="text/css"/>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td height="50" align="center" class="title">管理员管理</td>
    </tr>
</table>
<?php
$con = mysql_connect("localhost", "root", "");
if (!$con) {
    die('Could not connect: ' . mysql_error());
}

// Create table in my_db database
mysql_select_db("my_db", $con);
$sql = "SELECT * FROM `Admin`";
$result = mysql_query($sql, $con);
$username = "";
while ($row = mysql_fetch_array($result)) {
    $username = $row['UserName'];
}
mysql_close($con);
?>
<div style="text-align:center; margin-top:10px">
    <fieldset style="width:50%;">
        <legend>修改管理员</legend>
        <br>

        <form name="form1" action="modify.php" method="post">
            <table width="68%" border="0" align="center" cellpadding="10" cellspacing="0" bordercolorlight="#FFFFFF"
                   bordercolordark="#CCCCCC">
                <tr>
                    <td width="20%" align="right" nowrap>用户名：</td>
                    <td width="50%"><input name="UserName" value="<?php echo $username ?>" type="text" class="inputtext"
                                           style="width:100%"></td>
                    <td width="30%">&nbsp;</td>
                </tr>
                <tr>
                    <td width="20%" align="right" nowrap>新密码：</td>
                    <td width="50%"><input name="Password" type="password" class="inputtext" id="WebPic"
                                           style="width:100%"></td>
                    <td width="30%">为空不修改</td>
                </tr>
                <tr>
                    <td height="40" colspan="3" align="center" valign="bottom" nowrap>
                        <input name="Submit" type="Submit" class="button" value="确认">
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="Submit2" type="reset" class="button" value="重置"></td>
                </tr>
            </table>
        </form>
    </fieldset>
</div>
<br>
</body>
</html>
